/* Geocache Terrain as a double */
sprintf(buff, fmp->printfc, wpt->gc_data.terr / 10.0);
} else
- if (strcmp(fmp->key, "GEOCACHE_TYPE") == 0) {
- /* Geocache Type TODO */
- sprintf(buff, fmp->printfc, "Geocache");
+ if (strcmp(fmp->key, "GEOCACHE_CONTAINER") == 0) {
+ /* Geocache Container */
+ sprintf(buff, fmp->printfc, gs_get_container(wpt->gc_data.container));
+ } else
+ if (strcmp(fmp->key, "GEOCACHE_TYPE") == 0) {
+ /* Geocache Type */
+ sprintf(buff, fmp->printfc, gs_get_cachetype(wpt->gc_data.type));
} else {
/* this should probably never happen */
}
{ gc_virtual, "Virtual" }
};
-static
geocache_type
gs_mktype(char *t)
{
return gt_unknown;
}
-static
+const char *
+gs_get_cachetype(geocache_type t)
+{
+ int i;
+ int sz = sizeof(gs_type_map) / sizeof(gs_type_map[0]);
+
+ for (i = 0; i < sz; i++) {
+ if (t == gs_type_map[i].type) {
+ return gs_type_map[i].name;
+ }
+ }
+ return "Unknown";
+}
+
geocache_container
gs_mkcont(char *t)
{
return gc_unknown;
}
+const char *
+gs_get_container(geocache_container t)
+{
+ int i;
+ int sz = sizeof(gs_container_map) / sizeof(gs_container_map[0]);
+
+ for (i = 0; i < sz; i++) {
+ if (t == gs_container_map[i].type) {
+ return gs_type_map[i].name;
+ }
+ }
+ return "Unknown";
+}
+
static
time_t
xml_parse_time( char *cdatastr )
example: IFIELD TIMET_TIME,"","%ld"
+ o GEOCACHE_DIFF
+ GEOCACHE_DIFF is valid only for geocaches and represents a DOUBLE
+ PRECISION FLOAT. A "three and a half star" cache would therefore be "3.5"
+
+ example: IFIELD GEOCACHE_DIFF,"","%3.1f"
+
+ o GEOCACHE_TERR
+ GEOCACHE_TERR is valid only for geocaches and represents a DOUBLE
+ PRECISION FLOAT. A "three and a half star" cache would therefore be "3.5"
+
+ example: IFIELD GEOCACHE_TERR,"","%3.1f"
+
+ o GEOCACHE_CONTAINER
+ GEOCACHE_CONTAINER is valid only for geocaches and is heavily influenced
+ by the Groundspeak container types. Examples would include "Micro"
+ and "Virtual".
+
+ example: GEOCACHE_CONTAINER,"","%s"
+
+ o GEOCACHE_TYPE
+ GEOCACHE_TYPE is valid only for geocaches and is heavily influenced
+ by the Groundspeak cache types. Examples would include "Event cache"
+ and "Multi-Cache".
+
+ example: GEOCACHE_TYPE,"","%s"
+
+
+
EXAMPLES:
--------